import { ref, computed,reactive } from "vue";
import { defineStore } from "pinia";

export const useCounterStore = defineStore("counter", () => {
  // 定义一个响应式的状态count
  const count = ref(0);

  // 使用计算属性
  const doubleCount = computed(() => count.value * 2);

  // 对count进行加一操作
  function increment() {
    count.value++;
  }

  return { count, doubleCount, increment };

});

export const usePerson =  defineStore("person",()=>{
  const person = reactive({
    name:"张三疯",
    age:12
  });

  // 

})
